package com.adrian.service.impl;

import com.adrian.mapper.ProductMapper;
import com.adrian.pojo.Product;
import com.adrian.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: Adrian
 * @Date: 2020/3/20 18:44
 * @Description:
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;


    @Override
    public List<Product> getProducts() {
        return productMapper.getProudect();
    }

    @Override
    public int addPrdouct(Product product) {
        return productMapper.addPrdouct(product);
    }

    @Override
    public int deleteProduct(int pid) {
        return productMapper.deleteProduct(pid);
    }

    @Override
    public Product getById(int pid) {
        return productMapper.getById(pid);
    }

    @Override
    public int updateById(Product product) {
        return productMapper.updateById(product);
    }
}
